<%def name="title()"></%def>
<%
    from portal.lib.auth import check_if_user_is_already_connected
    from pylons import request, response, session, tmpl_context as c, url
    def print_name():
    	if check_if_user_is_already_connected():
    		return session['name']
    	return ''
%>    
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Readthematrix: ${self.title()}</title>
        <link rel="stylesheet" type="text/css" href="/design.css" media="screen" />
        <script type="text/javascript" src="/jQuery/jQuery-1.6.2.min.js"></script>
        <script type="text/javascript" src="/jQuery/jquery-ui-1.8.14.custom.min.js"></script>
        <script type="text/javascript" src="/js/functions.js"></script>
        %if check_if_user_is_already_connected():
	        <script type="text/javascript">
				var us_id = '${session['user']}';
		        var username = '${session['last_name']}';
	        </script>
        %endif
    </head>
    <body>
    <div id="index-header">
    	<span id="index-heade-name">Welcome ${print_name() | n}</span>
    	
     	<span id="header-auth-link">
    		%if check_if_user_is_already_connected():
		    	<a href="/chat">Chat</a>-<a href="/start">Home</a>-<a href="/auth/logout">Logout</a>
		    	
		    %else:
		    	<a href="/auth/login">Login</a>
		    %endif
		    	
    	</span>
    </div>
		
<!-- *** BEGIN page content *** -->
${self.body()}
<!-- *** END page content *** -->

    </body>
</html>